import time
t = time.time()  # 获取当前时间戳
print(t)
t = time.localtime()  # 结构化时间
print(t)  # time.struct_time(tm_year=2024, tm_mon=7, tm_mday=17, tm_hour=20, tm_min=28, tm_sec=55, tm_wday=2, tm_yday=199, tm_isdst=0)
print(t.tm_year, type(t.tm_year))  # 2024 <class 'int'>
s = time.strftime('%Y-%m-%d %H:%M:%S', t)
print(s)  # 2024-07-17 20:31:06
from my_package import my_tools
print(my_tools.get_time())
